package com.mooc.lib_common.model

import android.os.Parcel
import android.os.Parcelable

/**
"hasLiked": false,
 * */
class CommentEntity() : Parcelable{

    var id = 0L
    var itemId = 0L
    var commentId = 0L
    var userId = 0L
    var commentType = 0
    var createTime = 0L
    var commentCount = 0
    var likeCount = 0
    var commentText = ""
    var imageUrl = ""
    var videoUrl = ""
    var width = ""
    var height = ""
    var hasLiked = ""
    var avatar = ""
    var name = ""

    constructor(parcel: Parcel) : this() {
        id = parcel.readLong()
        itemId = parcel.readLong()
        commentId = parcel.readLong()
        userId = parcel.readLong()
        commentType = parcel.readInt()
        createTime = parcel.readLong()
        commentCount = parcel.readInt()
        likeCount = parcel.readInt()
        commentText = parcel.readString()!!
        imageUrl = parcel.readString()!!
        videoUrl = parcel.readString()!!
        width = parcel.readString()!!
        height = parcel.readString()!!
        hasLiked = parcel.readString()!!
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeLong(id)
        parcel.writeLong(itemId)
        parcel.writeLong(commentId)
        parcel.writeLong(userId)
        parcel.writeInt(commentType)
        parcel.writeLong(createTime)
        parcel.writeInt(commentCount)
        parcel.writeInt(likeCount)
        parcel.writeString(commentText)
        parcel.writeString(imageUrl)
        parcel.writeString(videoUrl)
        parcel.writeString(width)
        parcel.writeString(height)
        parcel.writeString(hasLiked)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<CommentEntity> {
        override fun createFromParcel(parcel: Parcel): CommentEntity {
            return CommentEntity(parcel)
        }

        override fun newArray(size: Int): Array<CommentEntity?> {
            return arrayOfNulls(size)
        }
    }

}